<?php
 class MY_Controller extends Controller{
 	var $_data=FALSE;
 	var $container="container";
    var $container_admin="container_admin";
 	function MY_Controller(){
 		parent::Controller();
 		$this->load->helper('form');
		$this->load->helper('url');
		$this->load->helper('gidaff_helper');
        $this->load->helper('date');
        $this->load->library('pagination');
        $this->load->library('session');
        $this->load->library('form_validation');
//        $this->load->library('upload');
 	}
 	function display_view($path){
 		$this->_data['view_path']=$path;
 		$this->load->view($this->container,$this->_data);
 	}
    function admin_view($path){
         $this->_data['view_path']=$path;
         $this->load->view($this->container_admin,$this->_data);
     }
 }
 class FrontEnd_Controller extends MY_Controller {
    function FrontEnd_Controller(){
	    parent::MY_Controller();
        $this->load->library('cart');
	    $header['page']="home/header";
	    $footer['page']="home/footer";
	    $sidebar['page']="sidebar";
	    $this->_data['sidebar']=$sidebar;
	    $this->_data['footer']=$footer;
	    $this->_data['header']=$header;
	    $this->_data['is_banner']=false;
	    $this->_data['is_sidebar']=true; 		
}

function translate(){
		 if($this->session->userdata('langue')==true){$key=$this->session->userdata('langue');}
        else {
        $key="fr";
        $this->session->set_userdata('langue',$key);
    }
        $this->_data['langue']=$this->home_m->translate($key);
	}
	
}

class Admin_Controller extends MY_Controller{
        function Admin_Controller(){
            parent::MY_Controller();
            $header['page']="admin/header";
            $footer['page'] ="admin/footer";
            $sidebar['page']="admin/sidebar";
            $this->_data['sidebar']=$sidebar;
            $this->_data['header']=$header;
            $this->_data['footer']=$footer;
            $this->_data['is_sidebar']=true;
            
        }
}